package com.mrroman.linksender.passdb;

import java.net.Authenticator;
import java.net.PasswordAuthentication;

import com.mrroman.linksender.ioc.In;
import com.mrroman.linksender.ioc.Name;

@Name("linksender.PasswordKeeperAuthenticator")
public class PasswordKeeperAuthenticator extends Authenticator {

	@In
	private PasswordKeeper passwordKeeper;
	
	@Override
	protected PasswordAuthentication getPasswordAuthentication() {
		return passwordKeeper.getPassword(getRequestingHost());
	}
	
	
}
